﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UI.xcgl
{
    public partial class xcglForm : Form
    {
        public DataTable table=null;
        public xcglForm()
        {
            InitializeComponent();
        }
        public void reloadTable()
        {
            table = new DataTable();
            table = BLL.UserManager.SelectStaffJobDx();
            skinDataGridView1.DataSource = table;
        }
        private void xcglForm_Load(object sender, EventArgs e)
        {
            table = new DataTable();
            table= BLL.UserManager.SelectStaffJobDx();
            skinDataGridView1.DataSource = table;
          //  DataColumn column=new DataColumn("提成");
          //  DataColumn  columntotal = new DataColumn("总计");
           // table.Columns.Add(column);
            //添加到成员函数
            skinDataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
       
        }

        private void 查看本月工资ToolStripMenuItem_Click(object sender, EventArgs e)
        {
          int cuid= Convert.ToInt32(skinDataGridView1.CurrentRow.Cells["员工编号"].Value);
          Model.UserInfo uinfo = new Model.UserInfo();
          uinfo.Uid = cuid;
          CurrentMonthSalaryForm saform = new CurrentMonthSalaryForm();
          saform.userinfo = uinfo;
          saform.Show();
        }

        private void 修改底薪ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void skinButton2_Click(object sender, EventArgs e)
        {
            xgbmdx dx = new xgbmdx();
            dx.Show();
        }

        private void 刷新_Click(object sender, EventArgs e)
        {
            reloadTable();
        }

        private void skinButton1_Click(object sender, EventArgs e)
        {
            if (textbox_search.Text == "" || textbox_search.Text == null)
            {
                MessageBox.Show("您什么都没输入！");
                return;
            }
            if (UI.Global.isNumber(textbox_search.Text) == false)
            {
                MessageBox.Show("您没有输入数字！");
                return;
            }
            Model.UserInfo uinfo = new Model.UserInfo();
            uinfo.Uid = Convert.ToInt32(textbox_search.Text);
            DataTable table = DAL.UserServer.SelectAStaffJobDxById(uinfo).Tables[0];
            skinDataGridView1.DataSource = table;
        }

        private void skinContextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {

        }
    }
}
